<script setup lang='ts'>
import { inject, onMounted } from 'vue'
const $echarts: any = inject('$echarts')
const option = {
  xAxis: {
    type: 'category',
    data: [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ]
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [ 820, 932, 901, 934, 1290, 1330, 1320 ],
      type: 'line',
      smooth: true
    }
  ]
}
const initChart = () => {
  const myChart = $echarts.init(document.getElementById('container'))
  myChart.setOption(option)
}
onMounted(() => {
  initChart()
})
</script>

<template>
  <div id="container" />
</template>
<style lang="scss" scoped>
#container {
  width: 1000px;
  height: 500px;
}
</style>
